#ifndef GAMEWIDGET_H
#define GAMEWIDGET_H

#include <QWidget>
#include "tiltwidget.h"
#include "singleplayermodule.h"
#include "gamesettingswidget.h"
#include "networkmodule.h"

class GameWidget : public QWidget
{
    Q_OBJECT
public:
//    Initializes a game widget mode has to be set explicitly by calling the switchTo functions
    GameWidget(GameSettingsWidget *settings,QWidget *parent = 0,NetworkModule *networkModule = 0);
    bool switchToNetworkVersion();
    bool switchToSingleGameVersion();
signals:
    void backClicked();
public slots:
    void startGameMultiplayer();
private slots:
    void startGame();
    void announceResult(bool win,int time);
    void synchedUpdatesSingleGame();
    void synchedUpdatesMultiplayerGame();
private:
    QPushButton *startGameButton;
    QPushButton *backToMenu;
    Noise *noise;
    QTimer *timer;
    TiltWidget *theTiltWidget;
    DrunkSceneModel *theModel;
    SinglePlayerModule *theSinglePlayerModule;
    GameSettingsWidget *gameSettings;
    NetworkModule *theNetworkModule;
    QGridLayout *layout;
    bool init;
};

#endif // GAMEWIDGET_H
